Be extremely restless, uneasy, impatient, or anxious, as in This child just can't sit still; she must have ants in her pants. This rhyming idiom calls up a vivid image of what might cause one to be jumpy. [ ; 1920s ]
.
Be eager for sexual activity, as in Bill's got ants in his pants for Rita. This usage is less common today. [ ; 1920s ]